【iOS】Fixes ellipsis carries background from trimmed text#39408
【iOS】Fixes ellipsis carries background from trimmed text#39408zhongwuzw wants to merge 13 commits into
Conversation
|
I don't think we want to mutate |
Base commit: 778fcec |
@javache Thanks for the review, I have no idea how to do it in the layout path, my thought is we can mutate the textStorage before drawing and restore the textStorage which we mutated after drawing. And I tested in new arch and it has the same issue. |
|
I would look at making this change in RCTTextShadowView and RCTTextLayoutManager (for the new architecture) |
|
@javache Friendly ping, thank you for any feedback :) |
javache
left a comment
There was a problem hiding this comment.
Please see my previous feedback about moving this logic on the background thread by using RCTTextShadowView/RCTTextLayoutManager. Please also ensure this is compatible with the new architecture.
08df8de to
aadbf6f
Compare
| layoutContext, | ||
| layoutConstraints, | ||
| nullptr); | ||
| hostTextStorage_); |
There was a problem hiding this comment.
Seems Fabric uses different textStorage in measure and draw path. We should share it.
…/fix_ellipsis_background
|
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
Thanks for investigating this. The changes look reasonable, but can we add gating here so we only execute this if numberOfLines is set? |
|
@javache Done :) |
|
@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
Hi @zhongwuzw, I know that you are fixing a specific issue, but there could be other style properties that we want to remove from the ellipsis. I think that the ellispis should keep the same style of the character that precedes it, not to have weird artifacts on the screen. |
|
@cipolleschi Hi, I just keep the same color related attributes as the character that precedes it. Other attributes like fontSize would impact the layout of the text. |
|
@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
This is failing internal builds with |
|
@javache done 😀 |
|
@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
This pull request was successfully merged by @zhongwuzw in fcb6cdc. When will my fix make it into a release? | How to file a pick request? |
|
This pull request has been reverted by b1c5432. |
…5412) Summary: Reland #39408 . Try to fix the crash #37926 (comment). cc. javache I changed the range from glyph to character because all attributes related APIs are character range. ## Changelog: [IOS] [FIXED] - Fixes ellipsis carries background from trimmed text Pull Request resolved: #45412 Test Plan: #37926 . Reviewed By: cipolleschi Differential Revision: D59681679 Pulled By: javache fbshipit-source-id: de4cb73e0304b8c0b0a40f4f6838b2c679747009
Summary:
Fixes #37926.
Changelog:
[IOS] [FIXED] - Fixes ellipsis carries background from trimmed text
Test Plan:
Demo code:
Before fix:

After fix:
